package com.drink.yan.intf.define;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * java类简单作用描述
 *
 * @Title:
 * @Package: com.drink.yan.intf.define.
 * @Author: M.simple
 * @Remark: The modified content
 * @CreateDate: 2023-12-09 13:53
 * @Version: v2.0
 */
public enum YanActivityStatusE {

	ready("ready", "未开始"),
	started("started", "进行中"),
	ended("ended", "已结束"),
	cancelled("cancelled", "已取消"),
	;

	private String code;

	private String remark;

	YanActivityStatusE(String code, String remark) {
		this.code = code;
		this.remark = remark;
	}

	public static List<String> effective() {
		YanActivityStatusE[] values = YanActivityStatusE.values();
		return Arrays.stream(values)
				.filter(x -> !YanActivityStatusE.cancelled.getCode().equals(x.code))
				.map(x -> x.getCode()).collect(Collectors.toList());
	}

	public static List<String> notEnd() {
		YanActivityStatusE[] values = YanActivityStatusE.values();
		return Arrays.stream(values)
				.filter(x -> !YanActivityStatusE.cancelled.getCode().equals(x.code))
				.filter(x -> !YanActivityStatusE.ended.getCode().equals(x.code))
				.map(x -> x.getCode()).collect(Collectors.toList());
	}

	public String getCode() {
		return code;
	}

	public String getRemark() {
		return remark;
	}

	public static void main(String[] args) {
		YanActivityStatusE[] values = YanActivityStatusE.values();
		StringBuffer sb = new StringBuffer();
		for(YanActivityStatusE yanOrderTypeE : values){
			sb.append(yanOrderTypeE.getCode()).append(":").append(yanOrderTypeE.getRemark()).append(" ");
		}
		System.out.println(YanActivityStatusE.effective());
	}
}
